var express = require('express');
var router = express.Router();
const Mock = require('mockjs')
var _ = require('lodash')

/* transfer api json */
router.post('/auth/list', function (req, res) {
    return res.json(Mock.mock({
        "list|8-50": [
            {
                "id": ()=> Mock.mock('@id'),
                name: "中国人民银行",
                "code|4-8": "xxx",
                address: '上海市普陀区金沙江路 1516 弄',
                status: 0,
            }
        ]
    }).list);
});

router.post('/auth-log/list', function (req, res) {
    return res.json(Mock.mock({
        "total|10-100": 100,
        "rows|10-100": [
            {
                "rn|+1": 1,
                "id": ()=> Mock.mock('@id'),
                "operaType": ()=> Mock.mock('@pick(["授权", "取消授权", "同步更新"])'),
                "code|1-8": "xxx",
                "preValue": ()=> Mock.mock('@pick(["未授权", "已授权"])'),
                "postValue": ()=> Mock.mock('@pick(["未授权", "已授权"])'),
                "authName": ()=> Mock.mock('@cname'),
                "time": ()=> Mock.mock('@datetime("yyyy-MM-dd HH:mm:ss")'),
                "address": '上海市普陀区金沙江路 1516 弄'
            }
        ]
    }));
});

module.exports = router;
